var latArr=[12,456,123,8654,234,853];
var longArr=[43,75,12,68,334,89];
	
var nearByView = Titanium.UI.createView({
	//backgroundColor:'#ffcc00',
	width:'100%',
	height:'85%',
	top:'0%',
	left:'0%'
});
var searchDialog = Titanium.UI.createOptionDialog({
options: ['Web','People','All'],
cancel:1
});

var mapDialog = Titanium.UI.createOptionDialog({
	options: ['Profile','Check-In','Favorite','Add Location','Notes','Cancel'],
	cancel:5
});

var controlView = Titanium.UI.createView({
	top:'0%',
	//backgroundColor:'#6e9608',
	left:'0%',
	width:'100%',
	height:'10%'
});

var searchText = Titanium.UI.createTextField({
	hintText:"Search",
	top:'5%',
	left:'0%',
	width:'80%',
	height:'100%',
	showCancel:false,
	autocorrect:true,
	
});

var searchButton = Titanium.UI.createButton({
	//backgroundImage:'images/selected_search.png',
	left:'80%',
	top:'5%',
	height:'100%',
	width:'20%'
});
controlView.add(searchButton);
controlView.add(searchText);



var mapContainer = Titanium.UI.createView({
	top:'10%',
	left:'0%',
	width:'100%',
	height:'91%',
	//backgroundColor:'red'
});


nearByView.add(mapContainer);

var typeTap = Titanium.UI.createView({
	bottom:'0%',
	left:'0%',
	width:'25%',
	height:'15%',
	backgroundColor:'#9c9c9c'
});

var listAllTap = Titanium.UI.createView({
	bottom:'0%',
	left:'25%',
	width:'25%',
	height:'15%',
	backgroundColor:'#9c9c9c'
});

var checkInTap = Titanium.UI.createView({
	bottom:'0%',
	left:'50%',
	width:'25%',
	height:'15%',
	backgroundColor:'#9c9c9c'	
});

var notesTap = Titanium.UI.createView({
	bottom:'0%',
	left:'75%',
	width:'25%',
	height:'15%',
	backgroundColor:'#9c9c9c'
});


// event

listAllTap.addEventListener('click',function() {
	listAllTap.backgroundColor="transparent";
});

//nearByView.add(typeTap);
//nearByView.add(listAllTap);
//nearByView.add(checkInTap);
//nearByView.add(notesTap);

var mountainView = Titanium.Map.createAnnotation({
	latitude:31.218214,
	longitude:29.93326,
	title:"Appcelerator Headquarters",
	subtitle:'Mountain View, CA',
	pincolor:Titanium.Map.SATELLITE_TYPE,
	//animate:true,
	//leftButton: '../images/appcelerator_small.png',
	myid:1 // CUSTOM ATTRIBUTE THAT IS PASSED INTO EVENT OBJECTS
});


var mapview = Titanium.Map.createView({
	mapType: Titanium.Map.STANDARD_TYPE,
	region: {latitude:31.048007, longitude:31.364851,
	latitudeDelta:0.03, longitudeDelta:0.03},
	animate:true,
	annotations:[mountainView]
});
mapContainer.add(mapview);


nearByView.add(controlView);
placesContainer.add(nearByView);
Titanium.include('/makan/control/mapViewHands.js');